import requests
import execjs


def get_t():
    url = "https://vipapi.qimingpian.com/DataList/productListVip"
    headers = {

        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36",
        "Host": "vipapi.qimingpian.com",
        "Origin": "https: // www.qimingpian.cn"

    }

    form_data = {

        "time_interval": "",
        "tag": "",
        "tag_type": "and",
        "province": "",
        "lunci": "",
        "page": 1,
        "num": 20,
        "unionid": "M27u7y0Vex2YLHdRjKU0uvQAyA80G74M2Dw+fJCEKdzBBoFguTRegCtl3MPc0m8JeJWqqIs6kiQsM8IbOYgM5A=="

    }

    response = requests.post(url, headers=headers, data=form_data)

    return response.json()["encrypt_data"]


def get_data():
    t = get_t()
    with open("16企名科技JS.js", "r", encoding="utf-8") as f:
        jscode = f.read()
        code = execjs.compile(jscode).call("o", t)

    return code


if __name__ == '__main__':
    data = get_data()
